FROM debian:13.1-slim
ADD keepalived-2.3.4.tar.gz /usr/local/
RUN sed -i 's/deb.debian.org/mirrors.ustc.edu.cn/g' /etc/apt/sources.list.d/debian.sources && \
apt-get -y update && apt-get -y install build-essential libssl-dev  libnl-3-dev && \
/usr/local/keepalived-2.3.4/configure --prefix=/usr/local/keepalived/ && \
make -j8 && make install && \
apt purge -y  build-essential && \
apt -y autoremove  && \
rm -rf /usr/local/keepalived-2.3.4 && \
rm -rf /var/lib/apt/lists/*
ENV PATH=$PATH:/usr/local/keepalived
WORKDIR /usr/local/keepalived
CMD ["keepalived","-v"]

# https://www.keepalived.org/download.html
# docker build -t registry.cn-hangzhou.aliyuncs.com/xiaoyilin/keepalived:2.3.4 .
# docker run -it --rm registry.cn-hangzhou.aliyuncs.com/xiaoyilin/keepalived:2.3.4 bash
# docker run --rm registry.cn-hangzhou.aliyuncs.com/xiaoyilin/keepalived:2.3.4
# docker push registry.cn-hangzhou.aliyuncs.com/xiaoyilin/keepalived:2.3.4